package com.zc.center;
import as.leap.vertx.rpc.impl.RPCServerOptions;
import as.leap.vertx.rpc.impl.VertxRPCServer;
import com.zc.center.service.MyServiceImpl;
import com.zc.common.ClusterVertx;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.reflections.Reflections;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * <pre>
 * @File：ParamUtil
 * @Version：1.0.0
 * @Author：Neil.Zhou
 * @CreateDate：2016/9/23 16:22
 * @Modify：
 * @ModifyDate：2016/9/23
 * @Descript： 参数 工具类
 * </pre>
 */
public class StartRunner{
    private static Logger logger = LogManager.getLogger(StartRunner.class.getName());
    public static Vertx clusterVertx;
    private static final Reflections reflections = new Reflections("com.zc.gateway");
    public static void main(String[] args) throws Exception {
         ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        logger.debug("=======================Runner  Deployment======================");
        VertxOptions vo=new VertxOptions();
        final Vertx vertx=Vertx.vertx(vo);
        clusterVertx= ClusterVertx.getAfreshClusterVertx(vertx,"192.168.10.186");
        RPCServerOptions rpcServerOptions = new RPCServerOptions(clusterVertx).setBusAddress("rpc.user").addService(new MyServiceImpl());
        new VertxRPCServer(rpcServerOptions);
    }
}
